import {createAPI, createFormAPI} from '@/utils/request'

export const getList = data => createAPI('/api/componentType', 'get', data)
export const getDetails = id => createAPI(`/api/componentType/${id}`, 'get')
export const updateData = data => createAPI(`/api/componentType/${data.id}`, 'put', data)
export const addData = data => createAPI(`/api/componentType`, 'post', data)
export const delData = id => createAPI(`/api/componentType/${id}`, 'delete')

// 二级分类处理
export const getSubList = data => createAPI('/api/classProperties', 'get', data)
export const getSubDetails = id => createAPI(`/api/classProperties${id}`, 'get')
export const updateSubData = data => createAPI(`/api/classProperties${data.id}`, 'put', data)
export const addSubData = data => createAPI(`/api/classProperties`, 'post', data)
export const delSubData = id => createAPI(`/api/classProperties${id}`, 'delete')
